home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tools / arexx-scripts / arexx-pack / apiglibv33.lha / APIG_Lib / easyrequest3.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1992-02-09  |  1.1 KB  |  43 lines

  1. /* Example of EasyRequest with IDCMP flags */
  2.  
  3. x = addlib("apig.library",0,-30,0)
  4.  
  5. call set_apig_globals()
  6.  
  7. portname = "easyreq3_port"     
  8. p = openport(portname)  
  9.  
  10. WaitForPort portname  
  11.  
  12. wintitle = "Easy Requester Example"
  13. winidcmp = CLOSEWINDOW 
  14. winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO
  15.  
  16. win = openwindow(portname,0,0,640,200,2,4,winidcmp,winflags,wintitle,null(),0,0,0)
  17.  
  18. reqtitle = "This is your EasyRequester"
  19.  
  20. reqtext = "Say Buddy If You Insert or Remove a Disk ..." '0a'x '0a'x 
  21. reqtext = reqtext || "   ... I'll go away"
  22.  
  23. reqgads  = " OKAY | MAYBE | NOWAY "
  24.  
  25. reqx = EASYREQUEST(win,reqtitle,reqtext,reqgads,null(),DISKINSERTED+DISKREMOVED,0)
  26.  
  27. call CLOSEWINDOW(win)
  28.  
  29. select 
  30.    /* **** NOTE ****   */
  31.    /* if requester was satisfied by IDCMP, the return value is negative */
  32.  
  33.    when (-1 * reqx) = DISKINSERTED then say "I see you Inserted a DISK"
  34.    when (-1 * reqx) = DISKREMOVED then say "I see you Removed a DISK"
  35.    when reqx = 1 then say " 'OKAY'  ... is OKAY with me too !"
  36.    when reqx = 2 then say " 'MAYBE' ... not sure uh ? "
  37.    when reqx = 0 then say " 'NOWAY' ... I'm outta here !"
  38.    otherwise nop
  39.  
  40. end
  41.  
  42. exit
  43.